/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gpstracking.DA;

import com.gpstracking.BE.*;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;

/**
 *
 * @author jmj
 */
public class TipoDispositivoDA {

    public static TipoDispositivo get(int id) {
    	Session hbsession = HUtil.getSession();
    	Transaction tx = hbsession.beginTransaction();
		tx.begin();
        Query query = hbsession.createQuery("FROM TipoDispositivo WHERE idTipoDispositivo = "+ id);
        List<TipoDispositivo> res =  (List<TipoDispositivo>) query.list();

        
        return res.isEmpty() ? null : res.get(0);


    }
    
}
